package com.sy.webdemo.config;

import com.sy.webdemo.interceptor.MyHandlerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author songyi
 * @className InterceptorConfiguration
 * @description 拦截器配置
 * @date 2020/8/17 0017 14:12
 */
@Configuration
public class InterceptorConfiguration implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration registration = registry.addInterceptor(new MyHandlerInterceptor());
        registration.addPathPatterns("/**");
    }
}
